package com.bit.aop;

import com.bit.aop.controller.TestController;
import com.bit.aop.proxy.HouseSubject;
import com.bit.aop.proxy.RealHouseSubject;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(DemoApplication.class, args);
		//默认情况下
		TestController bean = context.getBean(TestController.class);  //普通类是cglib
		System.out.println(bean.getClass().toString());

//		HouseSubject subject = (HouseSubject) context.getBean("realHouseSubject");
//		System.out.println(subject.getClass().toString());


		RealHouseSubject subject = (RealHouseSubject) context.getBean("realHouseSubject");
		System.out.println(subject.getClass().toString());
	}

}
